package net.easyjava.third.letv.bean;

import com.alibaba.fastjson.annotation.JSONField;
import net.easyjava.tools.BaseBean;

/**
 * 上传视频返回的中间件
 * Created by wxnacy on 16/6/28.
 */
public class LetvVideo extends BaseBean {
    private static final long serialVersionUID = -3590309228658984016L;
    @JSONField(name = "video_id")
    private String videoId;//视频ID

    @JSONField(name = "video_unique")
    private String videoUnique;//视频唯一标识码

    @JSONField(name = "video_name")
    private String videoName;//视频名称
    /**
     * 视频状态：

     10表示可以正常播放
     20表示转码失败；21表示审核失败；22表示片源错误；23表示发布失败；24表示上传失败
     30表示处理中；31表示审核中；32表示无视频源；33表示上传初始化；34表示视频上传中
     40表示停用
     */
    private int status;
    @JSONField(name = "video_duration")
    private int videoDuration;//播放时长，单位为秒
    @JSONField(name = "initial_size")
    private int initialSize;//上传文件原始大小，单位为字节
    @JSONField(name = "error_code")
    private int errorCode;//错误码，视频处理失败的错误码（0: 成功, 其他值: 失败）
    @JSONField(name = "error_desc")
    private String errorDesc;//错误描述，视频处理失败的具体原因描述
    @JSONField(name = "file_md5")
    private String fileMd5;//视频源文件的MD5值
    @JSONField(name = "isdownload")
    private int isDownload;//是否可以下载 0不可以 1可以
    private String videoUrl;//视频地址
    private String playUrl;//播放地址
    private String img;//视频截图URL地址



    public LetvVideo() {
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public void setVideoUrl(String videoUrl) {
        this.videoUrl = videoUrl;
    }

    public boolean isDownload(){
        return this.isDownload == 1;
    }

    public int getIsDownload() {
        return isDownload;
    }

    public void setIsDownload(int isDownload) {
        this.isDownload = isDownload;
    }

    /**
     * 判断是否可以播放
     * @return
     */
    public boolean isCanPlay(){
        return this.status == 10;
    }

    public String getPlayUrl() {
        return playUrl;
    }

    public void setPlayUrl(String playUrl) {
        this.playUrl = playUrl;
    }

    public String getVideoId() {
        return videoId;
    }

    public void setVideoId(String videoId) {
        this.videoId = videoId;
    }

    public String getVideoUnique() {
        return videoUnique;
    }

    public void setVideoUnique(String videoUnique) {
        this.videoUnique = videoUnique;
    }

    public String getVideoName() {
        return videoName;
    }

    public void setVideoName(String videoName) {
        this.videoName = videoName;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public int getVideoDuration() {
        return videoDuration;
    }

    public void setVideoDuration(int videoDuration) {
        this.videoDuration = videoDuration;
    }

    public int getInitialSize() {
        return initialSize;
    }

    public void setInitialSize(int initialSize) {
        this.initialSize = initialSize;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorDesc() {
        return errorDesc;
    }

    public void setErrorDesc(String errorDesc) {
        this.errorDesc = errorDesc;
    }

    public String getFileMd5() {
        return fileMd5;
    }

    public void setFileMd5(String fileMd5) {
        this.fileMd5 = fileMd5;
    }
}
